$(document).ready(function() {
    $.ajax({
        url : "/record/list",
        dataType: 'json',
        type : "get",
        async : true,
        success : function(result) {
            let data = result;
            let str = "";
            let expression = ""

            str += "<table>" + "<tr><th>编号</th><th>表达式</th><th>结果</th><th>时间</th></tr>";
            for (let i = 0; i < data.length; i++) {
                expression = data[i].expression.replace("*", "×").replace("/", "÷");
                str += "<tr><td>" + (i+1) + "</td><td>" + expression +
                    "</td><td>" + data[i].result + "</td><td>" + data[i].submitTime + "</td></tr>";
            }
            str += "</table>"
            $("#table_list").replaceWith(str);
        },
        error : function (result) {
            $("#table_list").replaceWith("查询失败！");
        }
    })
})